package cn.hiapi.shop.query;

import cn.hiapi.basic.entity.BasicEntity;
import cn.hiapi.basic.jpa.pageable.QueryWrapper;
import cn.hiapi.basic.jpa.query.BasicQuery;
import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.Setter;

/**
 * @author AdinZ
 * @date 2023/1/31 0:25
 */
@Setter
@Getter
public class CommentQuery extends BasicQuery {
    private long shopId;
    @ApiModelProperty("是否回复 0 买家评论,1商家回复")
    private Integer reply;

    @ApiModelProperty("评分类型 1 好评, 2中评, 3差评")
    private Integer scoreType;

    @Override
    public QueryWrapper getQueryWrapper() {
        QueryWrapper wrapper = super.getBasicQueryWrapper();
        wrapper
                .eq("shopId", shopId)
                .eq("scoreType", scoreType)
                .eq("reply", reply);

        return wrapper;
    }
}
